﻿using Oracle.DataAccess.Client;
using System;
using System.Data;
using System.Data.Common;

namespace TurtleEngine.Databases
{
	 /// <summary>
	 ///
	 /// </summary>
	 public class Oracle : BaseConnect
	 {
		  /// <summary>
		  /// The _connection
		  /// </summary>
		  private OracleConnection _connection;

		  /// <summary>
		  /// Initializes a new instance of the <see cref="Oracle" /> class.
		  /// </summary>
		  public Oracle()
		  {
				_connection = new OracleConnection();
		  }

		  /// <summary>
		  /// Adds the column details.
		  /// </summary>
		  /// <param name="columnInfo">The column info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddColumnDetails(DataRow columnInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the function details.
		  /// </summary>
		  /// <param name="functionInfo">The function info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddFunctionDetails(DataRow functionInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the procedure details.
		  /// </summary>
		  /// <param name="procedureInfo">The procedure info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddProcedureDetails(DataRow procedureInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the table details.
		  /// </summary>
		  /// <param name="tableInfo">The table info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddTableDetails(DataRow tableInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the trigger details.
		  /// </summary>
		  /// <param name="triggerInfo">The trigger info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddTriggerDetails(DataRow triggerInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the uddt details.
		  /// </summary>
		  /// <param name="uddtInfo">The uddt info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddUddtDetails(DataRow uddtInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Adds the view details.
		  /// </summary>
		  /// <param name="viewInfo">The view info.</param>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override void AddViewDetails(DataRow viewInfo)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Connects the specified connection string.
		  /// </summary>
		  /// <param name="connectionString">The connection string.</param>
		  /// <returns></returns>
		  public override bool Connect(string connectionString)
		  {
				try
				{
					 _connection = new OracleConnection(connectionString);
					 base.Connect(connectionString);
					 return true;
				}
				catch (Exception)
				{
					 return false;
				}
		  }

		  /// <summary>
		  /// Connections the string builder.
		  /// </summary>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override string ConnectionStringBuilder()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Disconnects this instance.
		  /// </summary>
		  public override void Disconnect()
		  {
				_connection.Close();
				base.Disconnect();
		  }

		  /// <summary>
		  /// Finds the database instances.
		  /// </summary>
		  /// <param name="server">The server.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override bool FindDatabaseInstances(string server)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Finds the database servers.
		  /// </summary>
		  /// <returns></returns>
		  public override DataTable FindDatabaseServers()
		  {
				DbProviderFactory factory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
				DbDataSourceEnumerator dsEnum = factory.CreateDataSourceEnumerator();

				return dsEnum != null ? dsEnum.GetDataSources() : null;
		  }

		  /// <summary>
		  /// Gets the column details.
		  /// </summary>
		  /// <param name="table">The table.</param>
		  /// <param name="column">The column.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetColumnDetails(string table, string column)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the database instances.
		  /// </summary>
		  /// <param name="server">The server.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataTable GetDatabaseInstances(string server)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all functions in database
		  /// </summary>
		  /// <returns>Table with a list of all the functions</returns>
		  public override DataTable GetFunctions()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the index details.
		  /// </summary>
		  /// <param name="index">The procedure.</param>
		  /// <returns></returns>
		  public override DataRow GetIndexDetails(string index)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all indexess in database
		  /// </summary>
		  /// <returns>Table with a list of all the Indexes</returns>
		  public override DataTable GetIndexes()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the procedure details.
		  /// </summary>
		  /// <param name="procedure">The procedure.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetProcedureDetails(string procedure)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all stored procedures in database
		  /// </summary>
		  /// <returns>Table with a list of all the stored procedures</returns>
		  public override DataTable GetProcedures()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the table column details.
		  /// </summary>
		  /// <param name="table">The table.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataTable GetTableColumnDetails(string table)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the table details.
		  /// </summary>
		  /// <param name="table">The table.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetTableDetails(string table)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all tables in database
		  /// </summary>
		  /// <returns>Table with a list of all the tables</returns>
		  public override DataTable GetTables()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the trigger details.
		  /// </summary>
		  /// <param name="view">The view.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetTriggerDetails(string view)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all triggers in database
		  /// </summary>
		  /// <returns>Table with a list of all the triggers</returns>
		  public override DataTable GetTriggers()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the uddt details.
		  /// </summary>
		  /// <param name="view">The view.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetUddtDetails(string view)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all UDDTs in database
		  /// </summary>
		  /// <returns>Table with a list of all the UDDTs</returns>
		  public override DataTable GetUddts()
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets the view details.
		  /// </summary>
		  /// <param name="view">The view.</param>
		  /// <returns></returns>
		  /// <exception cref="System.NotImplementedException"></exception>
		  public override DataRow GetViewDetails(string view)
		  {
				throw new NotImplementedException();
		  }

		  /// <summary>
		  /// Gets all views in database
		  /// </summary>
		  /// <returns>Table with a list of all the views</returns>
		  public override DataTable GetViews()
		  {
				throw new NotImplementedException();
		  }
	 }
}